<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Product</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>


<body>
    <div th:replace="common/Top"></div>

    <div id="Content">
        <div id="BackLink">
            <!--        <a href="" th:text="|Return to ${product.categoryId}|">Return to FISH</a>-->
            <a th:href="@{/catalog/viewCategory(categoryId=${product.categoryId})}" th:text="|Return to ${product.categoryId}|" ></a>
        </div>

        <div id="Catalog">

            <h2 th:text="${product.name}">Product Name</h2>

            <table>
                <tr>
                    <th>Item ID</th>
                    <th>Product ID</th>
                    <th>Description</th>
                    <th>List Price</th>
                    <th>&nbsp;</th>
                </tr>

                <!--            <tr>-->
                <!--                <td>-->
                <!--                    <a href="/catalog/viewItem?itemId=EST-1">Item</a>-->
                <!--                </td>-->
                <!--            </tr>-->

                <tr th:each="item:${session.itemList}">
                    <td> <a th:href="@{/catalog/viewItem?itemId={itemId}(itemId=${item.itemId})}" th:text="${item.itemId}"></a> </td>

                    <td th:text="${session.product.productId}">  </td>

                    <td th:text="|${item.attribute1} ${product.name}|"></td>

                    <td th:text="'$'+${#numbers.formatDecimal(item.listPrice,0,'COMMA',2,'POINT')}"></td>

                    <td>
                        <a class="Button" th:href="@{/cart/addItemToCart?itemId={itemId}(itemId=${item.itemId})}">Add to Cart</a>
                    </td>
                </tr>
            </table>

        </div>
    </div>

    <div th:replace="common/Bottom"></div>
</body>
</html>